Bump to latest upstream release.
Removed upstreamed: 020-replace_uint16_t
Manually rebased: 010-gcc14.patch
To fix the following build error, added two commits from upstream:
020-nvme-print-add-fallback-for-.patch
021-pligins-netapp-add-include-of-libgen.h-for-basename.patch
Tested the resulting binary and it seems fine:
% nvme smart-log /dev/nvme0 | grep "temperature"
temperature : 42 °C (315 K)
Link to upstream issue: https://github.com/linux-nvme/nvme-cli/issues/2743
Build error:
../nvme-print.c: In function 'is_temperature_fahrenheit':
../nvme-print.c:805:19: error: 'LC_MEASUREMENT' undeclared (first use in this function)
805 | setlocale(LC_MEASUREMENT, "");
| ^~~~~~~~~~~~~~
../nvme-print.c:805:19: note: each undeclared identifier is reported only once for each function it appears in
Build system: x86/64
Build-tested: x86/64
Run-tested: x86/64
Signed-off-by: John Audia <[email protected]>
include $(TOPDIR)/rules.mk
PKG_NAME:=nvme-cli
-PKG_VERSION:=2.9.1
+PKG_VERSION:=2.11
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/linux-nvme/nvme-cli/archive/refs/tags/v$(PKG_VERSION)
-PKG_HASH:=4b61684a1d23de1d9d0abd3f273799c60256c0e2a2e68a790d7945183fe33874
+PKG_HASH:=5e4dc73dbb488c6b1e6ad1c78d0c62b624076fcb0c052bd9039674a1dbd6517b
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=LICENSE
--- a/plugins/virtium/virtium-nvme.c
+++ b/plugins/virtium/virtium-nvme.c
-@@ -32,14 +32,14 @@ static char vt_default_log_file_name[256
- struct vtview_log_header {
- char path[256];
- char test_name[256];
-- long time_stamp;
-+ time_t time_stamp;
- struct nvme_id_ctrl raw_ctrl;
- struct nvme_firmware_slot raw_fw;
- };
-
- struct vtview_smart_log_entry {
- char path[256];
-- long time_stamp;
-+ time_t time_stamp;
- struct nvme_id_ns raw_ns;
- struct nvme_id_ctrl raw_ctrl;
- struct nvme_smart_log raw_smart;
@@ -127,7 +127,7 @@ static void vt_convert_smart_data_to_hum
capacity = le64_to_cpu(smart->raw_ns.nsze) * lba;
--- /dev/null
+From 9444ce03a27b8d423f8170cf75f56d48d8a0a659 Mon Sep 17 00:00:00 2001
+Date: Mon, 11 Nov 2024 23:06:03 +0100
+Subject: [PATCH] nvme-print: add fallback for non-standard locale category
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+LC_MEASUREMENT is a GNU (libc) extension - fall back to LC_ALL if it's
+not defined.
+
+Fixes build with musl libc
+
+---
+ nvme-print.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/nvme-print.c
++++ b/nvme-print.c
+@@ -797,6 +797,10 @@ static bool is_fahrenheit_country(const
+ return false;
+ }
+
++#ifndef LC_MEASUREMENT
++#define LC_MEASUREMENT LC_ALL
++#endif
++
+ static bool is_temperature_fahrenheit(void)
+ {
+ const char *locale, *underscore;
+++ /dev/null
-From 650070ad5d4a97fc87f9018743e3b566deba36c8 Mon Sep 17 00:00:00 2001
-Date: Tue, 21 May 2024 14:09:32 -0700
-Subject: [PATCH] plugins/ssstc: Replace __uint16_t with uint16_t
-
-uint16_t is ISO defined and comes from stdint.h, makes it
-portable across glibc and musl on linux.
-
----
- plugins/ssstc/ssstc-nvme.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- a/plugins/ssstc/ssstc-nvme.c
-+++ b/plugins/ssstc/ssstc-nvme.c
-@@ -64,9 +64,9 @@ void show_ssstc_add_smart_log_jsn(struct
- unsigned int nsid, const char *devname)
- {
- struct json_object *root, *entry_stats, *dev_stats, *multi;
-- __uint16_t wear_level_min = 0;
-- __uint16_t wear_level_max = 0;
-- __uint16_t wear_level_avg = 0;
-+ uint16_t wear_level_min = 0;
-+ uint16_t wear_level_max = 0;
-+ uint16_t wear_level_avg = 0;
- uint64_t raw_val = 0;
-
- root = json_create_object();
--- /dev/null
+From ac4818952c872ba465a2d0f48634f9a79aae064f Mon Sep 17 00:00:00 2001
+Date: Mon, 11 Nov 2024 22:34:57 +0100
+Subject: [PATCH] plugins/netapp: add include of libgen.h for basename(3)
+ prototype
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes build with musl libc.
+
+---
+ plugins/netapp/netapp-nvme.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/plugins/netapp/netapp-nvme.c
++++ b/plugins/netapp/netapp-nvme.c
+@@ -22,6 +22,7 @@
+ #include <unistd.h>
+ #include <errno.h>
+ #include <string.h>
++#include <libgen.h>
+
+ #include "common.h"
+ #include "nvme.h"